package wqh.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wqh.dao.DeviceDao;
import wqh.domain.Device;
import wqh.service.DeviceService;

import java.util.List;

@Service("deviceService")
public class DeviceServiceImpl implements DeviceService{

    @Autowired
    private DeviceDao deviceDao;

    public List<Device> findAllRecord() {
        return this.deviceDao.findAllRecord();
    }

    public Device findAllById(Integer id) {
        return this.deviceDao.findAllById(id);
    }

    public Device findAllByIP(String ip) {
        return this.deviceDao.findAllByIP(ip);
    }

    public Device findAllByNameAndIp(Device device) {
        return this.deviceDao.findAllByNameAndIp(device);
    }

    public String findIpByName(String device_name) {
        return this.deviceDao.findIpByName(device_name);
    }

    public int insertRecord(Device device) {
        return this.deviceDao.insertRecord(device);
    }

    public int updateDateById(Device device) {
        return this.deviceDao.updateDateById(device);
    }

    public int deleteById(Integer id) {
        return this.deviceDao.deleteById(id);
    }
}
